# -*- coding: utf-8 -*-
import scrapy


class GuideSpider(scrapy.Spider):
    name = 'guide'
    allowed_domains = ['news.sina.com.cn']
    start_urls = ['http://news.sina.com.cn/guide']

    def parse(self, response):
        sectionlist = response.selector.css('div.content div.main div.article div.section')
        for section in sectionlist:
            sectionname=section.css('h2::text').extract()
            print(".".join(sectionname))
            rowlist=section.css('div.clearfix')
            for row in rowlist:
                rowname=row.css('h3.tit02 a::text').extract_first()
                print(rowname)
                print("-"*70)
                itemlist=row.css('li a::text').extract()
                print(".".join(itemlist))
                print("=" * 70)


